//
//  BSObject.m
//  Spriter_forCocs2d
//
//  Created by bean on 13/4/17.
//
//

#import "BSObject.h"
@implementation BSObject
- (id)init
{
    self = [super init];
    if (self)
    {
        m_angle = 0;
        m_point = CGPointZero;
        m_pivot = CGPointZero;
        m_scale = CGPointZero;
        m_file = 0;
        m_folder = 0;
        m_alpha = 1;
    }
    return self;
}
- (id)initWithImagfilder:(int)folder
                    file:(int)file
                   point:(CGPoint)point
                   angle:(float)angle
                   pivot:(CGPoint)pivot
                   scale:(CGPoint)scale
                    spin:(int)spin
                     key:(int)key
                    time:(int)time
                       a:(float)a
{
    self = [super init];
    if (self)
    {
        m_angle = angle;
        m_point = point;
        m_pivot = pivot;
        m_scale = scale;
        m_spin = spin;
        m_key = key;
        m_folder = folder;
        m_file = file;
        m_time = time;
        m_alpha = a;
    }
    return self;
}

- (CGPoint)point
{
    return m_point;
}
- (CGPoint)pivot
{
    return m_pivot;
}
- (CGPoint)scale
{
    return m_scale;
}
- (float)angle
{
    return m_angle;
}
- (float)alpha
{
    return m_alpha * 255;
}
- (NSString*)imgName
{
    return m_imgName;
}
- (int)spin
{
    return m_spin;
}
- (int)key
{
    return m_key;
}
-(int)folder
{
    return m_folder;
}
-(int)file
{
    return m_file;
}
- (NSString *)description
{
    return [NSString stringWithFormat:@"folder = %d, file = %d, x = %f, y = %f, pivot.x = %f pivod.y = %f , scale x = %f, scale y = %f, angle = %f , key = %d /n \n",
            m_folder, m_file, m_point.x, m_point.y, m_pivot.x, m_pivot.y, m_scale.x , m_scale.y, m_angle, m_key];
}
- (int)time
{
    return m_time;
}
@end

